<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button onclick="add()">添加</button>
</body>
<script>
    function add() {
        sessionStorage.setItem('al', "2");
        alert("crate ok");
    }
    function all(e) {
        alert(e)
    }
    // 获取到dom元素中的页面
    window.addEventListener("storage", all);
</script>
</html>